home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / FilterReader.java < prev    next >
Text File  |  1998-09-22  |  3KB  |  113 lines

  1. /*
  2.  * @(#)FilterReader.java    1.6 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.io;
  16.  
  17.  
  18. /**
  19.  * Abstract class for reading filtered character streams.
  20.  *
  21.  * @version     1.6, 98/07/01
  22.  * @author    Mark Reinhold
  23.  * @since    JDK1.1
  24.  */
  25.  
  26. public abstract class FilterReader extends Reader {
  27.  
  28.     /**
  29.      * The underlying character-input stream, or null if the stream has been
  30.      * closed
  31.      */
  32.     protected Reader in;
  33.  
  34.     /**
  35.      * Create a new filtered reader.
  36.      */
  37.     protected FilterReader(Reader in) {
  38.     super(in);
  39.     this.in = in;
  40.     }
  41.  
  42.     /**
  43.      * Read a single character.
  44.      *
  45.      * @exception  IOException  If an I/O error occurs
  46.      */
  47.     public int read() throws IOException {
  48.     return in.read();
  49.     }
  50.  
  51.     /**
  52.      * Read characters into a portion of an array.
  53.      *
  54.      * @exception  IOException  If an I/O error occurs
  55.      */
  56.     public int read(char cbuf[], int off, int len) throws IOException {
  57.     return in.read(cbuf, off, len);
  58.     }
  59.  
  60.     /**
  61.      * Skip characters.
  62.      *
  63.      * @exception  IOException  If an I/O error occurs
  64.      */
  65.     public long skip(long n) throws IOException {
  66.     return in.skip(n);
  67.     }
  68.  
  69.     /**
  70.      * Tell whether this stream is ready to be read.
  71.      *
  72.      * @exception  IOException  If an I/O error occurs
  73.      */
  74.     public boolean ready() throws IOException {
  75.     return in.ready();
  76.     }
  77.  
  78.     /**
  79.      * Tell whether this stream supports the mark() operation.
  80.      */
  81.     public boolean markSupported() {
  82.     return in.markSupported();
  83.     }
  84.  
  85.     /**
  86.      * Mark the present position in the stream.
  87.      *
  88.      * @exception  IOException  If an I/O error occurs
  89.      */
  90.     public void mark(int readAheadLimit) throws IOException {
  91.     in.mark(readAheadLimit);
  92.     }
  93.  
  94.     /**
  95.      * Reset the stream.
  96.      *
  97.      * @exception  IOException  If an I/O error occurs
  98.      */
  99.     public void reset() throws IOException {
  100.     in.reset();
  101.     }
  102.  
  103.     /**
  104.      * Close the stream.
  105.      *
  106.      * @exception  IOException  If an I/O error occurs
  107.      */
  108.     public void close() throws IOException {
  109.     in.close();
  110.     }
  111.  
  112. }
  113.